<?php 
require_once(dirname(__FILE__)."/../../libs/login/login.php");
require_once(dirname(__FILE__)."/../../libs/dbclass/dbconnect.php");
require_once(dirname(__FILE__)."/../../admin/libs/config_class.php");
require_once(dirname(__FILE__)."/../../config/comm.php");
$lg=new login();
$lg->checklogin("admin_member");//检验是否登录
$cf=new config();
$condition=' order by classorder asc';
$info=$cf->getInfos("friendly_link",$condition);
//print_r($getrs);
//删除友情链接
if($mc->Ismp($_GET["del"])!=""){
	$id=$_GET["del"];
	$db->cmd("delete from friendly_link where id=".$id);
	$mc->msg("删除成功","link_content.php");
}

$path="友情链接";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="../css/css.css" rel="stylesheet" type="text/css" />
</head>
<body style="background:#fff"> 
<div class="content">
    <div class="right">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="100%" height="24" class="top_head">&nbsp;</td>
      </tr>
      <tr>
        <td valign="top">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="1%" align="right"  height="45">&nbsp;</td>
                <td width="99%" >
                 <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="55%" style="padding-left:20px;padding-top:10px;"><img src="../images/head.gif" width="13" height="11"><b><?php echo $path;?></b><a href="link_content_add.php" style=" margin-left:20px; text-decoration:underline;">友情链接添加</a></td>
                    <td width="45%" align="right">&nbsp;</td>
                  </tr>
                </table>
                </td>
              </tr>
            </table>
        </td>
      </tr>
      <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0" class="bg">
          <tr>
            <td valign="middle" align="center" >
             <table width="92%"   border="1px" bordercolor="#ccc" cellspacing="0px" style="border-collapse:collapse">
                <thead align="center" bgcolor="#EEEEEE">
                  <tr>
                	<th width="4%"  align="center" height="30" >序号</th>
                	<th width="8%"  align="center"><strong>网站LOGO</strong></th>
                	<th width="15%" align="center"><strong>名称</strong></th>
                	  <th width="25%"  align="center"><strong>链接</strong></th>
                	 <th width="8%"  align="center"><strong>是否可见</strong></th>
                     <th width="5%" align="center"><strong>排序</strong></th>
                    <th width="15%" align="center">编辑</th>
                </tr>
              </thead>
              <tbody>
              <?php if(count($info)>0){?>
              <?php foreach($info as $rs){?>
              <tr align="center" bgcolor="#FFFFFF">
              	  <td height="40" align="center"><?php echo $rs["index"]+1;?></td>
              	  <td height="40" align="center" valign="middle"><img src="<?php echo $rs["files"];?>"  height="30" /></td>
              	  <td height="40" align="center"><?php echo $rs["webname"];?></td>
              	  <td height="40" align="center"><?php echo $rs["url"];?></td>
              	  <td height="40" align="center"><?php if($rs["isshow"]==1){?>可见<?php }else{?>隐藏<?php }?></td>
              	  <td height="40" align="center"><?php echo $rs["classorder"];?></td>
              	  <td height="40"  align="center"  >
                      <bdo>
                        <input type="submit" name="button7" id="button7" value="编辑" onclick="location.href='link_content_edit.php?id=<?php echo $rs["id"];?>'"/>
                      </bdo>
                      <bdo>
                        <input type="submit" name="button9" id="button9" value="删除" onclick="if(confirm('您确定删除本项吗?')){location.href='?del=<?php echo $rs["id"];?>'}"/>
                      </bdo>
                  </td>
            	</tr>
            	<?php }?>  
            	<?php }else{?>
            	<tr align="center" bgcolor="#FFFFFF">
            		  <td height="40" align="center" colspan="9">没有相关资料，赶紧添加吧！</td>
            	</tr>
            	
            	<?php }?>
              </tbody>
            </table>
            </td>
          </tr>
        </table>
        </td>
      </tr>
    </table>
    </div>
</div>
</body>
</html>